<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="p" uri="/WEB-INF/tld/pagination.tld"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title>销售价格资料</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css"
			href="<%=request.getContextPath()%>/css/public.css">
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/sorttable.js"></script>
		<script language="JavaScript"
			src="<%=request.getContextPath()%>/js/public.js"></script>
		<script language="JavaScript"
			src="<%=request.getContextPath()%>/js/salesprice.js" charset="utf-8"></script>
		
		<script type="text/javascript">
		
		
			function show(show){
			
				var client = document.getElementById("client");
				var material = document.getElementById("material");
				if(show == 'material'){
					client.style.display="";
					material.style.display="none" ;
				}
				else if(show == 'client'){
					material.style.display="" ;
					client.style.display="none";
				}
			
			}
		
		</script>
	</head>

	<body>
		<div id="info_all">
			<div id="info_top">
				销售价格资料
			</div>
			<!-- 主输入区 -->
			<!-- 功能按钮 -->
			<s:form action="getSalespriceBy.action" theme="simple" id="delrow"
				cssStyle="margin-top:0px;">
			<div id="btn">
				<input type="button" value="新增" onClick="addAction('showAddSalesprice','showAddSalesprice')" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				<input type="button" value="修改" onClick="updateSalesprice('showEditSalesprice','showEditSalesprice')" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				<input type="button" value="删除" onClick="delSalesprice('deleteSalesprice','deleteSalesprice')" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				<input type="button" value="审核" onClick="auditingSalesprice('auditingSalesprice','auditingSalesprice')" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				<input type="button" value="反审核" onClick="reAuditingSalesprice('reAuditingSalesprice','reAuditingSalesprice')" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
				<input type="button" value="限价" onClick="controlPrice('showControlSalesprice','showControlSalesprice')" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" />
			</div>
			<div id="info_main">				
				<div id="select">
					<hr>
					<table>
						<tr>
							<td>
								物料名称
							</td>
							<td>
								<s:hidden name="salesprice.materialId" id="materialId"></s:hidden>
								<s:textfield name="materialName" id="materialName" size="15" readonly="true"></s:textfield>
								<img src="images/kookup.gif" style="cursor:pointer" onclick="openWin('materialAction!select.action','material',1050,700,0)">
							</td>
							<td>
								客户名称
							</td>
							<td>
								<s:hidden name="salesprice.customerId" id="customerId"></s:hidden>
								<s:textfield name="customerName" id="customerName" size="15" readonly="true"></s:textfield>
								<img src="images/kookup.gif" style="cursor:pointer" onclick="openWin('selectCustomer.action','customer',1050,700,0)">
							</td>
							<td>状态</td>
							<td>
								<select name="salesprice.auditState" style="width:96px">
									<option value="2">全部</option>
									<option value="0">未审核</option>	
									<option value="1">审核</option>						
								</select>
							
							</td>
						</tr>
					</table>
				</div>
				<div class="sele">
					<input type="submit" value="查询" onFocus="this.blur()"
						onmouseover="this.className='btnover'"
						onmouseout="this.className='btnout'" class="btnsize" />
					<input type="reset" value="重置" onFocus="this.blur()"
						onmouseover="this.className='btnover'"
						onmouseout="this.className='btnout'" class="btnsize"/>
						<hr>
				</div>
				<div align="left">
					<input type="button" value="客户" onFocus="this.blur()"
						onmouseover="this.className='btnover'"
						onmouseout="this.className='btnout'" class="btnsize" onClick="show('material')"/>&nbsp;
					<input type="reset" value="物料" onFocus="this.blur()"
						onmouseover="this.className='btnover'"
						onmouseout="this.className='btnout'" class="btnsize" onClick="show('client')"/>
						<hr>
				</div>
				<!-- 信息显示栏 -->
				<div id="info_info2">
					<table width="1220" cellpadding="1"  cellspacing="1"  class="sortable" id="client" >
						<thead>
							<tr>
								<th><input type="checkbox" name="checkbox" onClick="selectAllByClient()"/></th>
								<th width="80px">
									审核标志
								</th>
								<th width="80px">
									客户名称
								</th>
								<th width="80px">
									客户代码
								</th>
								<th width="80px">
									物料代码
								</th>
								<th width="80px">
									物料名称
								</th>
								<th width="80px">
									规格型号
								</th>
								<th width="80px">
									辅助属性
								</th>
								<!-- 
								<th width="110px">
									计量单位代码
								</th>
								 -->
								<th width="100px">
									计量单位
								</th>
								<th width="110px">
									销货量（从）
								</th>
								<th width="110px">
									销货量（到）
								</th>
								<th width="80px">
									报价
								</th>
								<th width="80px">
									最低限价
								</th>
								<th width="90px">
									生效日期
								</th>
								<th width="90px">
									失效日期
								</th>
								<!-- 
								<th width="110px">
									最低价格控制
								</th>
								 -->
							</tr>
						</thead>
						<tbody id="mbody">
							<s:if test="!salespriceDTOList.isEmpty()">
								<s:iterator value="salespriceDTOList">
								<tr>
									<td>
										<s:checkbox name="salelist" fieldValue="%{salesprice.salesPriceId}"
													theme="simple" />
									</td>
									<td>
									<s:if test="salesprice.auditState==0">未审核</s:if>
									<s:else>审核</s:else>
									
									</td>
									<td>
										<s:property value="customer.customerName" />
									</td>
									<td>
										<s:property value="customer.customerCode" />
									</td>
									<td>
										<s:property value="material.materialName" />
									</td>
									<td>
										<s:property value="material.materialCode" />
									</td>
									<td>
										<s:property value="material.spec" />&nbsp;
									</td>
									<td>
										<s:property value="material.materialAttribute" />&nbsp;
									</td>
									<!-- 
									<td>
										<s:property value="material.measureGroupID" />
									</td>
									 -->
									<td>
										<s:property value="material.basicMeasureUnit" />
									</td>
									<td>
										<s:property value="salesprice.salesNumberFrom" />
									</td>
									<td>
										<s:property value="salesprice.salesNumberTo" />
									</td>
									<td>
										<s:property value="salesprice.bid" />
									</td>
									<td>
										<s:property value="salesprice.bottomBid" />
									</td>
									<td>
										<s:property value="salesprice.validDate" />
									</td>
									<td>
										<s:property value="salesprice.invalidDate" />
									</td>
									<!-- 
									<td>
										<s:property value="material.materialAttribute" />
									</td>
									 -->
								</tr>
								</s:iterator>
							</s:if>
								<s:else>
									<tr>
										<td colspan="5">
										</td>
									</tr>
								</s:else>
						</tbody>
				  </table>
				  <table width="1220" cellpadding="1"  cellspacing="1"  class="sortable" id="material" style="display:none ">
						<thead>
							<tr>
								<th><input type="checkbox" name="checkbox" onClick="selectAllByMaterial()"/></th>
								<th width="80px">
									审核标志
								</th>
								<th width="80px">
									物料代码
								</th>
								<th width="80px">
									物料名称
								</th>
								<th width="80px">
									客户名称
								</th>
								<th width="80px">
									客户代码
								</th>
								<th width="80px">
									规格型号
								</th>
								<th width="80px">
									辅助属性
								</th>
								<!-- 
								<th width="110px">
									计量单位代码
								</th>
								 -->
								<th width="100px">
									计量单位
								</th>
								<th width="110px">
									销货量（从）
								</th>
								<th width="110px">
									销货量（到）
								</th>
								<th width="80px">
									报价
								</th>
								<th width="80px">
									最低限价
								</th>
								<th width="90px">
									生效日期
								</th>
								<th width="90px">
									失效日期
								</th>
								<!-- 
								<th width="110px">
									最低价格控制
								</th>
								 -->
							</tr>
						</thead>
						<tbody id="mbody">
						
								<s:if test="!salespriceDTOList.isEmpty()">
								<s:iterator value="salespriceDTOList">
								<tr>
									<td>
										<s:checkbox name="salelist" fieldValue="%{salesprice.salesPriceId}"
													theme="simple" />
									</td>
									<td>
									<s:if test="salesprice.auditState==0">未审核</s:if>
									<s:else>审核</s:else>
									
									</td>
									<td>
										<s:property value="material.materialName" />
									</td>
									<td>
										<s:property value="material.materialCode" />
									</td>
									
									<td>
										<s:property value="customer.customerName" />
									</td>
									<td>
										<s:property value="customer.customerCode" />
									</td>
									
									<td>
										<s:property value="material.spec" />
									</td>
									<td>
										<s:property value="material.materialAttribute" />
									</td>
									<!-- 
									<td>
										<s:property value="material.measureGroupID" />
									</td>
									 -->
									<td>
										<s:property value="material.basicMeasureUnit" />
									</td>
									<td>
										<s:property value="salesprice.salesNumberFrom" />
									</td>
									<td>
										<s:property value="salesprice.salesNumberTo" />
									</td>
									<td>
										<s:property value="salesprice.bid" />
									</td>
									<td>
										<s:property value="salesprice.bottomBid" />
									</td>
									<td>
										<s:property value="salesprice.validDate" />
									</td>
									<td>
										<s:property value="salesprice.invalidDate" />
									</td>
									<!-- 
									<td>
										<s:property value="material.materialAttribute" />
									</td>
									 -->
								</tr>
								</s:iterator>
							</s:if>
								<s:else>
									<tr>
										<td colspan="5">
										</td>
									</tr>
								</s:else>
				  </table>
				  <s:if test="!salespriceDTOList.isEmpty">
							<tr style="font-size: 12px;">
								<div align="center">
									<font color="#FF0000"> 共<s:property value="page.total" /> 页 第
										<s:property value="page.cpage" /> 页 <p:page cpage="%{page.cpage}"
											total="%{page.total}" url="%{page.url}" /> </font>
								</div>
							</tr>
						</s:if>
					<script language="javascript">  
						//("表格名称","奇数行背景","偶数行背景","点击后背景");
						 mouseclick("client","#ffffff","#ffffff","#e6f0fd");
						 //("表格名称","奇数行背景","偶数行背景");
						 //setcolor("t","#ffffff","#ffffff");
						
					</script>
				</div>
			</div>
			</s:form>
		</div>
		
	</body>
</html>